﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="topic.aspx.cs" Inherits="forum_topic" %>


<%@ Register src="../UserControls/CHeaderControl.ascx" tagname="CHeaderControl" tagprefix="uc1" %>
<%@ Register src="../UserControls/CFooterControl.ascx" tagname="CFooterControl" tagprefix="uc2" %>

<%@ Register src="../UserControls/blocksubscribe.ascx" tagname="blocksubscribe" tagprefix="uc3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title><%=city%>讨论区</title>
      <script>
          function delete_confirm(e) {
              if (event.srcElement.outerText == "－删除")
                  event.returnValue = confirm("确定删除本话题吗?");


          }
          document.onclick = delete_confirm;</script>
</head>
<body>
    <form id="form1"  runat="server" >
    

    <uc1:CHeaderControl ID="CHeaderControl1" runat="server" />
    <asp:HiddenField ID="hidbbsid" runat="server" />
    <div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="forum">
	<div class="dashboard" id="dashboard">
	    <ul>
        <li class="current"><a href="/forum/index.aspx">所有</a><span></span></li>
     
           <li><a href="/forum/city.aspx">
        <%if (CurrentCity != null)
          { %>
          
        <%=CurrentCity.Name%>讨论区
         
        <% }
          else
          {%>
          全部城市讨论区
        <% }%>
       </a><span></span></li>
        <li><a href="/forum/aspublic.aspx">公共讨论区</a><span></span></li></ul>
	</div>
    <div id="content" class="coupons-box clear">
		<div class="box clear">
            
            <div class="box-content">
                <div class="head">
                    <h2><%=topicmodel.Title%></h2>
					<ul class="filter" style="position:absolutely;bottom:0px;clear:both;float:none;"><li><a href="#reply">＋回复</a></li>
                    
                    <%if (IsManage)
                      { %>
                    <li><a href="topic.aspx?bbsid=<%=Request["id"] %>" ask="确定删除本话题吗？">－删除</a></li><li><a href="topic.aspx?top=<%=Request["id"].ToString() %>&id=<%=Request["id"].ToString() %>"  >＃置顶</a></li>
                    <% }%>
                    </ul>
				</div>
                <div class="sect">
				<table id="replies-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">

               <% if (topicmodel != null)
                  { %>
                <tr>
                  <% 
                         
                   usermodel = userbll.GetModel(Convert.ToInt32(topicmodel.User_id));
                       
                      
                             %>
					<td width="48" valign="top"><div class="avatar"><img src="<%=usermodel.Avatar %>" width="48" height="48" /></div></td>
					<td width="660">
						<div class="author">
                       
							<span style="float:right;"><%=topicmodel.create_time%>
                            
                              <%if (IsManage)
                                { %>
                            &nbsp;<a href="topic.aspx?bbsid=<%=topicmodel.id %>&id=<%=topicmodel.id%>"  ask="确定删除本话题吗？" >－删除</a>
                            
                            <% }%>
                            </span><b><%=usermodel.Username%></b><div class="clear"></div>
						
                        </div>
						<div class="topic-content">
							<%=topicmodel.Content%>
						</div>
					</td>
					</tr>
                    <% }%>
                <%foreach(Maticsoft.Model.topic topmodel in bbslist){

                      usermodel = userbll.GetModel(Convert.ToInt32(topmodel.User_id));
                       %>
					<tr>
					<td width="48" valign="top"><div class="avatar"><img src="<%=usermodel.Avatar %>" width="48" height="48" /></div></td>
					<td width="660">
						<div class="author">
							<span style="float:right;"><%=Gettime(topmodel.id)%>
                            
                               <%if (IsManage)
                                 { %>
                            &nbsp;<a href="topic.aspx?del=<%=topmodel.id %>&id=<%=topmodel.Parent_id %>"  ask="确定删除本话题吗？">－删除</a>
                            <% }%>
                            </span><b><%=usermodel.Username %></b><div class="clear"></div>
						</div>
						<div class="topic-content">
							<%=topmodel.Content%>
						</div>
					</td>
					</tr>
                    <% }%>
			
					<tr><td colspan="2"><%= strpage%></td></tr>
				</table>	
				</div>
				<div class="head" id="reply">
					<h2>我要回复</h2>
				</div>
				<div class="sect consult-form">
			
					<textarea style="width:480px;height:240px;" name="content" group="a" id="forum-new-content" class="f-textarea" require="true" datatype="require"></textarea>
					<p class="commit"><input type="submit" value="发布"  name="commit" group="a" id="leader-submit"  class="formbutton validator"/></p>
		
                    <%if (IsLogin == false)
                      { %>
					请先<a href="/account/Login.aspx">登录</a>或<a href="/account/signup.aspx">注册</a>再提问
				
                    <% }%>
					<div class="clear"></div>
				</div>
            </div>
            
        </div>
    </div>
    <div id="sidebar">
	<uc3:blocksubscribe ID="blocksubscribe1" runat="server" />
         </div>
</div>

</div> <!-- bd end -->
</div> <!-- bdw end -->


    <uc2:CFooterControl ID="CFooterControl1" runat="server" />
    

    </form>
</body>
</html>
